home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / codeli_1 / setup.exe / _SETUP.1 / frmDownloadDisplay.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-07-21  |  4.4 KB  |  133 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  3. Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
  4. Begin VB.Form frmDownloadDisplay 
  5.    Caption         =   "Download and Display HTML, RTF, or Text"
  6.    ClientHeight    =   5085
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   6615
  10.    Icon            =   "frmDownloadDisplay.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   5085
  14.    ScaleWidth      =   6615
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.TextBox URL 
  17.       Height          =   285
  18.       Left            =   600
  19.       TabIndex        =   0
  20.       Text            =   "http://www.geocities.com/SiliconValley/Way/6445/main.html"
  21.       Top             =   3360
  22.       Width           =   4695
  23.    End
  24.    Begin InetCtlsObjects.Inet Inet1 
  25.       Left            =   5760
  26.       Top             =   2520
  27.       _ExtentX        =   1005
  28.       _ExtentY        =   1005
  29.    End
  30.    Begin VB.CommandButton Command1 
  31.       Caption         =   "&Display"
  32.       Default         =   -1  'True
  33.       Height          =   375
  34.       Left            =   5400
  35.       TabIndex        =   1
  36.       Top             =   3360
  37.       Width           =   1095
  38.    End
  39.    Begin RichTextLib.RichTextBox RichTextBox1 
  40.       Height          =   3135
  41.       Left            =   120
  42.       TabIndex        =   2
  43.       Top             =   120
  44.       Width           =   6375
  45.       _ExtentX        =   11245
  46.       _ExtentY        =   5530
  47.       _Version        =   327680
  48.       ReadOnly        =   -1  'True
  49.       ScrollBars      =   3
  50.       AutoVerbMenu    =   -1  'True
  51.       TextRTF         =   $"frmDownloadDisplay.frx":0442
  52.    End
  53.    Begin VB.Label Label4 
  54.       Alignment       =   1  'Right Justify
  55.       AutoSize        =   -1  'True
  56.       Caption         =   "Written for the VB Center Code Library"
  57.       BeginProperty Font 
  58.          Name            =   "Small Fonts"
  59.          Size            =   6.75
  60.          Charset         =   0
  61.          Weight          =   400
  62.          Underline       =   0   'False
  63.          Italic          =   0   'False
  64.          Strikethrough   =   0   'False
  65.       EndProperty
  66.       Height          =   165
  67.       Left            =   4140
  68.       TabIndex        =   6
  69.       Top             =   4560
  70.       Width           =   2355
  71.    End
  72.    Begin VB.Label Label3 
  73.       Alignment       =   1  'Right Justify
  74.       AutoSize        =   -1  'True
  75.       Caption         =   "http://www.geocities.com/SiliconValley/Way/6445"
  76.       BeginProperty Font 
  77.          Name            =   "MS Sans Serif"
  78.          Size            =   8.25
  79.          Charset         =   0
  80.          Weight          =   700
  81.          Underline       =   0   'False
  82.          Italic          =   0   'False
  83.          Strikethrough   =   0   'False
  84.       EndProperty
  85.       ForeColor       =   &H00800000&
  86.       Height          =   195
  87.       Left            =   2160
  88.       TabIndex        =   5
  89.       Top             =   4800
  90.       Width           =   4365
  91.    End
  92.    Begin VB.Label Label2 
  93.       Caption         =   $"frmDownloadDisplay.frx":050B
  94.       Height          =   400
  95.       Left            =   120
  96.       TabIndex        =   4
  97.       Top             =   3840
  98.       Width           =   6375
  99.    End
  100.    Begin VB.Label Label1 
  101.       AutoSize        =   -1  'True
  102.       Caption         =   "URL:"
  103.       Height          =   195
  104.       Left            =   120
  105.       TabIndex        =   3
  106.       Top             =   3390
  107.       Width           =   375
  108.    End
  109. Attribute VB_Name = "frmDownloadDisplay"
  110. Attribute VB_GlobalNameSpace = False
  111. Attribute VB_Creatable = False
  112. Attribute VB_PredeclaredId = True
  113. Attribute VB_Exposed = False
  114. Private Sub Command1_Click()
  115.     Dim txt As String
  116.     Dim b() As Byte
  117.     On Error GoTo ErrorHandler
  118.     Command1.Enabled = False
  119.     ' This opens the file specified in the URL text box
  120.     b() = Inet1.OpenURL(URL.Text, 1)
  121.     txt = ""
  122.     For t = 0 To UBound(b) - 1
  123.         txt = txt + Chr(b(t))
  124.     Next
  125.     ' This loads the opened file into the RichTextBox control
  126.     RichTextBox1.Text = txt
  127.     Command1.Enabled = True
  128.     Exit Sub
  129. ErrorHandler:
  130.     MsgBox "The document you requested could not be found.", vbCritical
  131.     Exit Sub
  132. End Sub
  133.